package com.zs.zcerp.approval.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zs.zcerp.approval.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ${comments}
 * 
 * @author Henry
 * @email *****@mail.com
 * @date 2021-04-09 20:58:44
 */

public interface QhChkmgrdMapper extends BaseMapper<QhChkmgrdEntity> {

    /**
     * 查找签核详细信息
     *
     * @param page 分页对象
     * @param qhChkmgrdEntity 签核，用于传递查询条件
     * @return Ipage
     */
    <T> IPage<QhChkmgrdEntity> findAprovalsDetailPage(Page<T> page, @Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);


    long countAprovalsDetail(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    /**
     * 当前对象签核
     * @param qhChkmgrdEntity
     */
    void updateChkStatus(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    /** 回签  destory(销毁) */
    void destorySignStatus (String orderNo);

    /**
     * 设置下个步骤为 当前核检
     * @param qhChkmgrdEntity
     */
    void updateNoteId(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);
    /**
     * 查找签核详细信息
     *
     * @param qhChkmgrdEntity 签核对象，用于传递查询条件
     * @return List<QhChkmgrdEntity>
     */
  //  List<QhChkmgrdEntity> findAprovalsDetail(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    /**
     *   销毁主表* 默认1 改成99
     * @param qhChkmgrdEntity
     */
    void updateStatus(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    /**
     *  查询报表
     * @param qhChkmgrdEntity
     */
    List<DestoryReportEntity> findListReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<QhChkmgrdEntity> findSignList(String orderNo);

    /**
     *    数据回传erp  改成1
     * @param orderNo
     */
    void rejectDestoryStatus(String orderNo);

    /**
     * AD 报表
     * @param qhChkmgrdEntity
     * @return
     */
    List<ADReportEntity> findAdReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    /**
     * AD 报表title数据
     * @param qhChkmgrdEntity
     * @return
     */
    List<ADReportEntity> findAdReportTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    SeReportEntity findSeReportTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<SeReportEntity> findSeReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<OrderReportEntity> findOrderReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    OrderFatrEntity findFatrOrderTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<OrderFatrEntity> findFatrReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);


    GAPOReportEntity findGAPOReportTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<GAPOReportEntity> findGAPOReport(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    MDPOReportEntity findMDPOReportTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<MDPOReportEntity> findMDPOReport(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    PO6ReportEntity findPO6Title(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    List<PO6ReportEntity> findPO6Report(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    PGReportEntity findPGTitle(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    List<PGReportEntity> findPGReport(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    List<OrderFatrEntity> findFainReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    OrderXPOEntity findXPOOrderTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<OrderXPOEntity> findXPOReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    OrderXPCEntity findXPCOrderTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<OrderXPCEntity> findXPCReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    /**
     * 补料采购单
     * @param qhChkmgrdEntity 查询参数
     * @return 抬头
     */
    OrderBPOTitleEntity findBPO19Title(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);
 /**
     * 补料总表转采购单
     * @param qhChkmgrdEntity 查询参数
     * @return 抬头
     */
    OrderBPOTitleEntity findBPO20Title(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    /**
     * 补料采购单/补料总表转采购单 明细
     * @param qhChkmgrdEntity 查询参数
     * @return 明细
     */
    List<OrderBPODetailEntity> findBPODetail(@Param("qhChkmgrdEntity")QhChkmgrdEntity qhChkmgrdEntity);

    KFPOReportEntity findKFPOTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<KFPOReportEntity> findKFPOReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    KFPRReportEntity findKFPRTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<KFPRReportEntity> findKFPRReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    KFPOReportEntity findKFPO2Title(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<KFPOReportEntity> findKFPO2Report(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    WOReportEntity findWOTitle(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<WOReportEntity> findWOReport(@Param("qhChkmgrdEntity") QhChkmgrdEntity qhChkmgrdEntity);

    List<EmpEntity> querySignYesterDay();

    List<SignDetail> selectDetail(@Param("orderNo") String orderNo, @Param("itemType") String itemType, @Param("orgId") String orgId);

    List<String> getOrderList(@Param("w") QhBasestdDEntity q);
}